//元数据的api
import request from "@/utils/request";
import uploadRequest from "@/utils/uploadRequest"
import downloadRequest from "@/utils/downloadRequest"
//获取文件树
export function getDirTree(query) {
  return request({
    url: "/standardAggregateCatalogue/getDirTree",
    method: "get",
    params: query,
  });
}
//创建文件夹/标准集
export function createDir(data) {
  return request({
    url: "/standardAggregateCatalogue/createDir",
    method: "post",
    data: data,
  });
}
//获取表头全量数据
export function getAllTableConfig() {
  return request({
    url: "/standardAggregate/getAllTableConfig",
    method: "get",
  });
}
//获取表头配置
export function getTableConfig() {
  return request({
    url: "/standardAggregate/getTableConfig",
    method: "get",
  });
}
//修改动态表头
export function editTableHeader(data) {
  return request({
    url: "/standardAggregate/editTableHeader",
    method: "put",
    data: data,
  });
}
//获取字段类型枚举
export function getFieldType() {
  return request({
    url: "/metadataFieldInfo/getFieldType",
    method: "get",
  });
}
//获取参考标准文件列表   
export function queryFileList(data) {
  return request({
    url: "/standardFileDir/queryFileList",
    method: "post",
    data: data,
  });
}
//创建标准
export function createStandard(data) {
  return request({
    url: "/standardAggregate/createStandard",
    method: "post",
    data: data,
  });
}
//查询标准   
export function queryStandard(data) {
  return request({
    url: "/standardAggregate/queryStandard",
    method: "post",
    data: data,
  });
}
//修改文件
export function updateDir(data) {
  return request({
    url: "/standardAggregateCatalogue/updateDir",
    method: "post",
    data: data,
  });
}
//标准集导入
export function importCatalogue(data) {
  return uploadRequest({
    url: "/standardAggregateCatalogue/importCatalogue",
    method: "put",
    data: data,
  });
}
//获取精度
export function getPrecisionNum() {
  return request({
    url: "/metadataFieldInfo/getPrecisionNum",
    method: "get",
  });
}
//获取时间字段类型枚举
export function getTimeFormatEnums() {
  return request({
    url: "/metadataFieldInfo/getTimeFormatEnums",
    method: "get",
  });
}
//标准集模板导出
export function exportStandardTemplate() {
  return request({
    url: "/standardAggregate/exportStandardTemplate",
    method: "get",
  });
}
//修改标准
export function updateStandard(data) {
  return request({
    url: "/standardAggregate/updateStandard",
    method: "put",
    data: data,
  });
}
//批量/单个--删除标准
export function removeStandard(data) {
  return request({
    url: '/standardAggregate/removeStandard',
    method: 'delete',
    data: data
  })
}
//标准集导出
export function exportStandard(data) {
  return downloadRequest({
    url: "/standardAggregate/exportStandard",
    method: "put",
    data: data,
  });
}
//标准集导入
export function importCatalogueAll(data) {
  return uploadRequest({
    url: "/standardAggregate/importCatalogue",
    method: "put",
    data: data,
  });
}